package Object::LvalueCallback;

use strict;
use Sub::Name;

sub TIESCALAR {
	my ($pkg,$get,$set) = @_;
	my $caller = (caller(1))[3];
	subname $caller.':get',$get;
	subname $caller.':set',$set;
	return bless [$get,$set],$pkg;
}
sub FETCH {
	my $self = shift;
	goto &{ $self->[0] };
}
sub STORE {
	my $self = shift;
	goto &{ $self->[1] };
}

1;
